class HeadGo extends egret.Sprite{
	private arr;
	private arrXY;
	private black;
	private white;
	public constructor() {
		super();
		this.arr=new Array();
		this.arrXY=new Array();
		this.black=new egret.Shape();
		this.black.graphics.beginFill(0x000000,1);
		this.black.graphics.drawRect(0,0,740,1136);
		this.black.alpha=0.6;
		this.addChild(this.black);

		this.white=new egret.Shape();
		this.white.graphics.beginFill(0xffffff,1);
		this.white.graphics.drawRect(0,0,740,1136);
		this.white.alpha=0;
		this.addChild(this.white);
		for(var z=1;z<=5;z++){
			var pic=new egret.Bitmap(RES.getRes("word"+z+"_png"));
			this.addChild(pic);
			var mask=new egret.Shape();
			mask.graphics.beginFill(0x000000,1);
			mask.graphics.drawRect(0,0,500,500);

			this.arr.push(mask);
			this.addChild(mask);
			switch(z){
				case 1:pic.x=25;pic.y=-67;break;
				case 2:pic.x=110;pic.y=155;break;
				case 3:pic.x=297;pic.y=391;break;
				case 4:pic.x=385;pic.y=555;break;
				case 5:pic.x=484;pic.y=889;break;
			}
			mask.x=pic.x;mask.y=pic.y;
			pic.mask=mask;
			this.arrXY.push(mask.x);
			// this.arrXY.push(mask.y);
		}
	}
	public Go(){
		for(var z=0;z<this.arr.length;z++){
			this.arr[z].x=-500;
			egret.Tween.get(this.arr[z]).wait(400+250*z).to({x:this.arrXY[z]+500},1000,egret.Ease.cubicOut);

	
		}
		var This=this;
		setTimeout(function(){
			egret.Tween.get(This.white,{loop:true}).to({alpha:0.2},200,egret.Ease.cubicOut).to({alpha:0},200,egret.Ease.cubicOut);
		},200);
		setTimeout(function(){
			egret.Tween.pauseTweens(This.white);
			egret.Tween.get(This.white).to({alpha:0},200);
			egret.Tween.get(This.black).to({alpha:0},700);
		},400+250*5)
	}
}